-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Various enhancements / fixes #56
Open
foxharp
wants to merge
29
commits into
sdushantha:master
Choose a base branch
from
foxharp:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This prevents sxiv from failing. Also, remove -flatten from magick args, since it does nothing in this context.
nsxiv isn't in Debian or Ubuntu (sxiv is), and the convert --> magick transition hasn't happened everywhere either. So be lenient.
No need to maintain a PID file anymore.
The window manager will probably do a better job of positioning than we will.
Specifically, add characters which are often confused if their shapes are too similar.
we shouldn't need kill -9, certainly not on ourselves
any viewer that supports inotify for updating the image view should work. the viewer could even be specified in with a config variable, but there would need to be a separate var for its options. gets messy.
also, simplify the preservation of the query string
the viewer is in a separate session, so won't be affected
also, disable ESC key, since my vi-centric fingers keep aborting fontpreview while trying to examine history
I'd normally worry about making such big changes to someone else's codebase, but this version is clearly mine now.
show error messages even if stderr is redirected
…essing unless -size is given, we now try and fit the image to the preview text. also, option processing revised. see usage.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Great script! Thanks for writing and sharing it. It was exactly what I needed this week.
I don't really expect you apply all of these changes I've made (though I don't think I've broken anything), but I'm including them all in the pull request so you can see them all easily.
Main changes: I tend to prefer pre-packaged programs, and since current Debian and Ubuntu don't include "nsxiv" or "magick", but do still have sxiv and convert, I've made the code adaptable for those. It will also work with "feh" as the viewer.
The fzf search string is now preserved after you select a font, so you don't need to keep retyping it.
The default preview text now includes some sequences of characters that are frequently confused in a poorly designed font (e.g., "1lI" -- and I see that github has chosen a terrible font!). Since I found fontpreview while trying to choose a better programming font, these are important.
A small change to the code eliminated the sxiv failure that I think was forcing the use of nsxiv. So some of the viewer restart code could go away.
Also, some usage errors weren't being caught. try:
./fontpreview -i some-font-file.otf
for instance. I got:
./fontpreview: line 58: -size: command not found
Fixed now.
If you'd like me to rework something, or put together a different pull request leaving some changes out, let me know. And obviously if you want to ignore it altogether, that's fine too. ;-)
Thanks again!